;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages pkgconf)
  #:use-module (guix build-system gnu)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages autotools)
  #:use-module ((guixrus contributors) #:prefix contributor:))

(define-public pkgconf
  ;; The last tag (1.8.0) was on 2021-07-25, and there's been a lot of activity
  ;; since then.
  (let ((commit "b0802cb3d19b5b963ad20eed464a2da6e7d7b0b5")
        (revision "0"))
    (package
     (name "pkgconf")
     (version (git-version "1.8.0" revision commit))
     (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/pkgconf/pkgconf")
                    (commit commit)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1xcpvzahrp34jhdfsazdhbj9byr2wqwmjx7jfarhpc1x4z3l37a0"))))
     (build-system gnu-build-system)
     (arguments
      ;; Kyua, which pkgconf uses for test suites, "cannot find test programs"
      ;; that it needs. (Omitting Kyua also means we drop dependencies on
      ;; pkg-config, Lua, and C++, so there's a silver lining here.)
      (list #:tests? #f))
     (native-inputs (list ;; Autom4te refuses to run with any earlier autoconf
                          ;; version.
                          autoconf-2.71
                          automake
                          libtool))
     (native-search-paths
      (list (search-path-specification
             (variable "PKG_CONFIG_PATH")
             (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig")))))
     (home-page "https://pkgconf.org")
     (synopsis "Package compiler and linker metadata toolkit")
     (description "@code{pkgconf} is a compiler and linker configuration
toolkit, mostly compatible with freedesktop.org's @code{pkg-config}. A library
called @code{libpkgconf} is provided to allow C programs to embed its
functionality.")
     (license license:isc)
     (properties `((maintainers . (,contributor:unmatched-paren)))))))
